package com.yanchangapp.ui.activity.manage;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.yanchangapp.R;
import com.yanchangapp.ui.presenter.MgDailyDetailAtPresenter;
import com.yanchangapp.ui.view.MgDailyDetailAtView;
import com.zxl.baselib.ui.base.BaseActivity;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 我的管理 -- 我的计划 -- 详情页
 */
public class MgDailyDetailActivity extends BaseActivity<MgDailyDetailAtView, MgDailyDetailAtPresenter> implements MgDailyDetailAtView {

    private static final String PLAN_ID = "plan_id";
    @BindView(R.id.ivToolbarNavigation)
    ImageView ivToolbarNavigation;
    @BindView(R.id.tvToolbarTitle)
    TextView tvToolbarTitle;
    private int planID;

    @Override
    protected void init() {
        if (getIntent() != null) {
            planID = getIntent().getIntExtra(PLAN_ID, 0);
        }
    }

    public static void show(Activity activity, int planID) {
        Intent intent = new Intent(activity, MgDailyDetailActivity.class);
        intent.putExtra(PLAN_ID, planID);
        activity.startActivity(intent);
    }

    @Override
    protected int provideContentViewId() {
        return R.layout.activity_mg_daily_detail;
    }

    @Override
    protected MgDailyDetailAtPresenter createPresenter() {
        return new MgDailyDetailAtPresenter(this);
    }

    @Override
    protected void initView(Bundle savedInstanceState) {
        if (planID == 0) {
            finish();
        }
        tvToolbarTitle.setText("今日计划详情");
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initListener() {
        ivToolbarNavigation.setOnClickListener(v -> finish());
    }

}
